import Vue from 'vue'

import VueRouter from 'vue-router'

import Home from '../views/home/Home.vue'

// 引用路由插件
// import Good_pri from '../views/home/Good_pri.vue'
Vue.use(VueRouter)

// 路由表
const routes = [
    {
        path: '/',
        redirect: '/zhuye',
        // component: Home
    },
    {
        name: 'good_desc',
        path: '/good_desc',
        component: () => import('../views/home/Good_desc.vue'),
        meta: {
            index: 2
        }
    },
    {
        name: "articledetail",
        path: '/articledetail',
        meta: {
            index: 2
        },
        component: () => import('../views/home/ArticleDetail.vue')
    },
    {
        name: 'detail',
        path: '/detail',
        component: () => import('../views/home/shoppingguide/guidedetail/Discount.vue'),
        meta: {
            index: 2
        }
    },
    {
        name: 'mycollect',
        path: '/mycollect',
        component: () => import('../views/home/my/MyCollect.vue'),
        meta: {
            index: 2
        }
    },
    {
        name: 'myteambuying',
        path: '/myteambuying',
        component: () => import('../views/home/my/MyTeambuying.vue'),
        meta: {
            index: 2
        }
    },
    {
        name: 'myfeedback',
        path: '/myfeedback',
        component: () => import('../views/home/my/MyFeedback.vue'),
        meta: {
            index: 2
        }
    },
    {
        name: 'search',
        path: '/search',
        meta: {
            index: 2
        },
        component: () => import('../views/home/Search.vue')
    },
    {
        name: 'login',
        path: '/login',
        meta: {
            index: 2
        },
        component: () => import('../views/login/login.vue')
    },
    {
        name: 'regist',
        path: '/regist',
        meta: {
            index: 2
        },
        component: () => import('../views/login/regist.vue')
    },
    {
        name: "home",
        path: '/zhuye',
        redirect: '/zhuye/index',
        component: Home,
        children: [
            {
                name: 'index',
                path: 'index',
                meta: {
                    index: 1
                },
                component: () => import('../views/home/daohang.vue')
            },
            {
                name: "goodarticle",
                path: 'goodarticle',
                meta: {
                    index: 1
                },
                component: () => import('../views/home/GoodArticle.vue')
            },
            {
                name: "gdprice",
                path: 'gdprice',
                meta: {
                    index: 1
                },
                component: () => import('../views/home/Good_pri.vue'),
            },
            {
                name: "my",
                path: 'my',
                meta: {
                    index: 1
                },
                component: () => import('../views/home/My.vue'),
            },


        ]
    },
    {
        name: 'searchlist',
        path: '/searchlist',
        meta: {
            index: 2
        },
        component: () => import('../views/home/SearchList.vue')
    }
]
const router = new VueRouter({
    mode: 'history',// 模式 hash, history
    routes
})
export default router
